package com.wjq.service;


import com.wjq.entity.Result;
import com.wjq.entity.ResultMap;
import com.wjq.mapper.ResultMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ResultServiceImpl implements ResultService{

    @Autowired
    private ResultMapper resultMapper;

    @Override
    public void addResult(Result result) {
        resultMapper.addResult(result);
    }

    @Override
    public void deleteResult(Integer id) {
        resultMapper.deleteResultById(id);
    }

    @Override
    public Result getResultList(ResultMap resultMap) {
        return resultMapper.selectResultById(resultMap);
    }

    @Override
    public List<Result> quesyList(Integer questionnaire_id) {
        List<Result> results = resultMapper.queryResultList(questionnaire_id);
        return  results;
    }

    @Override
    public List<Result> getAnswer(Integer questionnaireId, Integer fillId) {
        return resultMapper.getAnswer(questionnaireId, fillId);
    }
}
